/*
 * @: 
 * @Version: 1.0
 * @Autor: ziwei
 * @Date: 2021-12-07 17:45:13
 * @LastEditors: ziwei
 * @LastEditTime: 2021-12-07 17:45:13
 */
/**
 * Initialize your data structure here.
 */
 var MyQueue = function() {
  this.arr = []
};

/**
* Push element x to the back of queue. 
* @param {number} x
* @return {void}
*/
MyQueue.prototype.push = function(x) {
  this.arr.push(x);
};

/**
* Removes the element from in front of queue and returns that element.
* @return {number}
*/
MyQueue.prototype.pop = function() {
this.arr.pop();
};

/**
* Get the front element.
* @return {number}
*/
MyQueue.prototype.peek = function() {
  return this.arr[arr.length]
};

/**
* Returns whether the queue is empty.
* @return {boolean}
*/
MyQueue.prototype.empty = function() {
 return this.arr.length == 0
};

/**
* Your MyQueue object will be instantiated and called as such:
* var obj = new MyQueue()
* obj.push(x)
* var param_2 = obj.pop()
* var param_3 = obj.peek()
* var param_4 = obj.empty()
*/
var obj = new MyQueue()
console.log(obj);
obj.push(1)
console.log(obj);